﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace UNF_Event_Posting
{
    public class EventPosting:epDataObject
    {
        private string SafeGetString(object obj)
        {
            string str = string.Empty;
            if (obj is string)
            {
                str = (string)obj;
            }
            return str;
        }

        private TimeSpan SafeGetTimeSpan(object obj)
        {
            TimeSpan time = TimeSpan.Zero;
            try
            {
                time = (TimeSpan)obj;
            }
            catch
            {
            }
            return time;
        }
        public Guid id
        {
            get
            {
                return (Guid)this["id"];
            }
            set
            {
                this["id"] = value;
            }
        }

        public String n_number
        {
            get
            {
                return SafeGetString(this["n_number"]);
            }
            set
            {
                this["n_number"] = value;
            }
        }

        public String event_name
        {
            get
            {
                return SafeGetString(this["event_name"]);
            }
            set
            {
                this["event_name"] = value;
            }
        }

        public int cat_id
        {
            get
            {
                return (int)this["cat_id"];
            }
            set
            {
                this["cat_id"] = value;
            }
        }

        public String event_description
        {
            get
            {
                return SafeGetString(this["event_description"]);
            }
            set
            {
                this["event_description"] = value;
            }
        }

        public String event_location
        {
            get
            {
                return SafeGetString(this["event_location"]);
            }
            set
            {
                this["event_location"] = value;
            }
        }

        public DateTime event_date
        {
            get
            {
                return (DateTime)this["event_date"];
            }
            set
            {
                this["event_date"] = value;
            }
        }

        public String event_notes
        {
            get
            {
                return SafeGetString(this["event_notes"]);
            }
            set
            {
                this["event_notes"] = value;
            }
        }

        public TimeSpan event_duration
        {
            get
            {
                return SafeGetTimeSpan(this["event_duration"]);
            }
            set
            {
                this["event_duration"] = value;
            }
        }

        public bool event_confirm
        {
            get
            {
                return (bool)this["event_confirm"];
            }
            set
            {
                this["event_confirm"] = value;
            }
        }

    }
    

}